/**
 * 
 */
package test;

import java.net.URI;
import java.net.URISyntaxException;

import hu.gbalage.owlforms.OWLFormsManager;
import hu.gbalage.owlforms.api.Form;

/**
 * @author Grill Balazs (balage.g@gmail.com)
 *
 */
public class GetTestForm {

	static Form cache = null;
	
	public static Form getForm(){
		if (cache == null){
			OWLFormsManager manager = new OWLFormsManager();
			
			try {
				manager.loadOntology(GetTestForm.class.getResource("/test/ontology/szocpont.owl").toURI());
				manager.loadOntology(GetTestForm.class.getResource("/test/ontology/szoctam.owl").toURI());
			} catch (URISyntaxException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			
			
			URI uri = URI.create("http://hu.gbalage.owlforms/examples/szoctam.owl#Szoctam_hallgato");
			
			Form form = manager.getFactory().createForm(uri);
			
			cache = form;
		}
		
		return cache; 
	}
	
}
